﻿@model Doan.Forum.Models.ProfileModel
@{
    ViewBag.Title = "Sửa profile";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
                                                                                                  
@using (Html.BeginForm("EditProfile", "Account", FormMethod.Post))
{
    <legend class="span7">Tạo tài khoản mới</legend>
    <div class="box-logon">
        <div class="editor-label ">
            <span>Tên đăng nhập</span>
        </div>
          <div class="editor-field">
              @Html.EditorFor(model => model.UserName)
              @Html.ValidationMessageFor(model => model.UserName)
          </div>
          <div class="editor-label ">
            <span>Email</span>
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>
          <div class="editor-label ">
            <span>Ngày sinh</span>
        </div>
          <div class="editor-field">
              @Html.EditorFor(model => model.Birthday)
              @Html.ValidationMessageFor(model => model.Birthday)
          </div>
          <div class="editor-label ">
            <span>Chữ ký</span>
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UserSignature)
            @Html.ValidationMessageFor(model => model.UserSignature)
        </div>
        <div class="editor-label ">
            <span>Ảnh đại diện</span>
        </div>
        <div class="editor-field">
            <input type="file" name="upImage" onchange="preview(this);" style="margin-right: 10px; width: 50%" />
            <img id="preview_image" alt="" src="" width="150px" height="150px">
        </div>
        <script>
            function preview(input) {
                if (input.files && input.files[0]) {
                    var reader = new FileReader();

                    reader.onload = function (e) {
                        $('#preview_image')
                            .attr('src', e.target.result)
                            .width(150)
                            .height(150);
                    };
                    reader.readAsDataURL(input.files[0]);
                }
            }
        </script>
        <div class="btnNewTopic">
            <input type="submit" value="Tạo tài khoản"  class="btn btn-success btn-large right"/>
        </div>
    </div>
}